package edu.fiu.cis.personalize.server.graph.update;

import edu.fiu.cis.personalize.server.graph.Document;
import edu.fiu.cis.personalize.server.graph.NodeType;
import edu.fiu.cis.personalize.server.graph.User;

public class DocumentUserUpdate extends GraphUpdate<Document, User> {

	@Override
	protected double computeWeight(Document d, User u) {
		double numClick = d.getClickedByUser(u);
		double numUser = d.getNumDocsClickedByUser(), totalClicks = d
				.getTotalClicksByUser();
		return numClick / (totalClicks / numUser);
	}

	@Override
	NodeType type1() {
		return NodeType.DOCUMENT;
	}

	@Override
	NodeType type2() {
		return NodeType.USER;
	}

}
